
/**
 * Ray
 * @version 1.0
 * @since 1.0
 * <p>
 * Created by Murphy at 2021/7/8 10:37
 **/

#pragma once
#include "Math.hpp"

namespace Stitches
{

class Ray
{

public:
    Ray() {}

    Ray(const Vec3f &origin, const Vec3f &direction) :
            mOrigin(origin), mDirection(direction) {}

    Vec3f at(float t) const { return mOrigin + mDirection * t; }

    const Vec3f &origin() const { return mOrigin; }

    const Vec3f &direction() const { return mDirection; }

private:
    Vec3f mOrigin;
    Vec3f mDirection;
};
}